package org.fuys.coder.common.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @projectName: fuys-low-coder
 * @package: org.fuys.coder.domain.common.page
 * @className: PageDTO
 * @author: WangJing
 * @description: 用于分页查询的内容
 * @date: 2024/7/9 0:05
 * @version: 1.0
 */

@AllArgsConstructor
@NoArgsConstructor
public class PageDTO {
    private Integer curPage;
    private Integer pageNum;

    public Integer getCurPage() {
        if(curPage==null){
            //默认返回第一页内容
            return 1;
        }
        return curPage;
    }

    public void setCurPage(Integer curPage) {
        //这个其实无所谓 设置的大 也查不到 而且不好控制
        this.curPage = curPage;
    }

    public Integer getPageNum() {
        if(pageNum==null){
            return 10;
        }
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        if(pageNum>20){
            this.pageNum=10;
        }else {
            this.pageNum = pageNum;
        }
    }
}
